Skip to content

Conversation

pchickey
Copy link
Contributor

As of bytecodealliance/wasi-rs#118, the wasi crate is just a facade to the wasip2 crate. Instead of depending on the facade, use wasip2 directly, in anticipation that we will one day soon use wasip3 as well behind the appropriate cfg.

@pchickey pchickey force-pushed the pch/use_wasip2_crate branch from d122fec to c664bd9 Compare September 11, 2025 21:29
@pchickey pchickey merged commit 6422f12 into main Sep 12, 2025
5 checks passed
@pchickey pchickey deleted the pch/use_wasip2_crate branch September 12, 2025 21:14
pub use http::header::{InvalidHeaderName, InvalidHeaderValue};
pub use http::method::InvalidMethod;
pub use wasi::http::types::{ErrorCode as WasiHttpErrorCode, HeaderError as WasiHttpHeaderError};
pub use wasip2::http::types::{ErrorCode as WasiHttpErrorCode, HeaderError as WasiHttpHeaderError};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider using semantic versioning for your crate, i.e. v0.5.5 -> v0.6.0 instead of v0.5.6 when changing the public API in a non-backwards compatible way. Thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be backwards compatible, since the wasi crate is now a thin re-export of the wasip2 crate: https://docs.rs/wasi/latest/src/wasi/lib.rs.html#1-2.

If you're running into compatibility problems, please consider filing an issue with your Cargo lockfile attached.

Copy link

@ignatz ignatz Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't get me wrong, this is not a big issue. Easy to fix on the consumer-side, just avoidable. I wouldn't want to file an issue because there's nothing much todo. Mostly an FYI

Yet, v0.5.5 -> v0.5.6

error[E0432]: unresolved import `wstd::wasi`
  --> crates/wasm-runtime-guest/src/lib.rs:46:9
   |
46 | pub use wstd::wasi;
   |         ^^^^^^^^^^ no `wasi` in the root
   |
help: consider importing this module instead
   |
46 - pub use wstd::wasi;
46 + pub use crate::wit::wasi;
   |

@pchickey
Copy link
Contributor Author

That wasn't supposed to be part of the public api but we didn't document it explicitly enough. See #90 (comment) #91

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants